package com.xiaoshou.pojo;

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "departments", catalog = "market")
public class Departments implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	private String id;
	private Client client;
	private User user;
	private String name;
	private String chairman;
	private String approbation;
	private Set<LecturesDepartmentsRel> lecturesDepartmentsRels = new HashSet<LecturesDepartmentsRel>();
	
	private List<Feedback> feedbackList;
	
	
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 40)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "clientid", nullable = false)
	public Client getClient() {
		return this.client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userid", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "name", length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "chairman", length = 45)
	public String getChairman() {
		return this.chairman;
	}

	public void setChairman(String chairman) {
		this.chairman = chairman;
	}

	@Column(name = "approbation", length = 45)
	public String getApprobation() {
		return this.approbation;
	}

	public void setApprobation(String approbation) {
		this.approbation = approbation;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "departments")
	public Set<LecturesDepartmentsRel> getLecturesDepartmentsRels() {
		return this.lecturesDepartmentsRels;
	}

	public void setLecturesDepartmentsRels(
			Set<LecturesDepartmentsRel> lecturesDepartmentsRels) {
		this.lecturesDepartmentsRels = lecturesDepartmentsRels;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "departments")
	public List<Feedback> getFeedbackList() {
		return feedbackList;
	}

	public void setFeedbackList(List<Feedback> feedbackList) {
		this.feedbackList = feedbackList;
	}


	
}